package com.centriole.serviceLog.service.Impl;

import com.centriole.serviceLog.dao.LogMapper;
import com.centriole.serviceLog.entity.Log;
import com.centriole.serviceLog.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 一开始的版本
 */
@Service
public class LogServiceImpl implements LogService {
	
	@Autowired
	private LogMapper logMapper;

	/**
	 * 根据条件查询
	 * @param log	查询体
	 * @return	List < Log >
	 */
	public List<Log> listByCondition(Log log){
		List<Log> list  = logMapper.getMapConditionsList(log);
		return list;
	}

	/**
	 * 保存log
	 * @param log	查询体
	 * @return	>1 表示插入成功； =0表示插入失败
	 */
	public boolean save(Log log){
		return logMapper.insert(log)>1;
	}

}

